package Function.ItemUse;

import VWorldGameStudio.FCBattleOrder;
import VWorldGameStudio.FCMonster;
import VWorldGameStudio.FCPlayerInfo;
import VWorldGameStudio.FCTank;

import java.util.Iterator;
import java.util.Map;

import static FCRendering.FCRMaster.fcv;
import static FCRendering.FCRMaster.gameSave;

public class ToolChuanZhengJi extends AItemUse{
    @Override
    public ItemUseResult directUse() {
        fcv.closeAllShowWindw();
        if(fcv.isBattle()){
            fcv.getMessage().add("什么也没发生");
            fcv.showMessage();
            return null;
        }
        //打开传真界面就行了
        Iterator<Map.Entry<String,String>> iterator = gameSave.getTankChuanZhenMaps().entrySet().iterator();
        while (iterator.hasNext()){
            fcv.getShowTankChuanzhenNames().add(iterator.next().getKey());
        }
        return null;
    }

    @Override
    public ItemUseResult useInMapTarget(int x, int y) {
        return directUse();
    }

    @Override
    public ItemUseResult useForMonsterTarget(FCBattleOrder battleOrder, FCMonster m) {
        return directUse();
    }

    @Override
    public ItemUseResult useForPlayerTarget(FCPlayerInfo p) {
        return directUse();
    }

    @Override
    public ItemUseResult useForTankTarget(FCTank t) {
        return directUse();
    }
}
